package de.yvert.jingle.impl.openexr;

import java.io.IOException;

public enum PixelType
{

INT(0, 4),
HALF(1, 2),
FLOAT(2, 4);

private final int code;
private final int size;

private PixelType(int code, int size)
{
	this.code = code;
	this.size = size;
}

public int getCode()
{ return code; }

public int getSize()
{ return size; }


public static PixelType decode(int type) throws IOException
{
	switch (type)
	{
		case 0 : return INT;
		case 1 : return HALF;
		case 2 : return FLOAT;
	}
	throw new IOException("Unknown pixel type: "+type);
}

}
